Skip to content

Fix collapsed dock wrapping#45

Merged
aliou merged 2 commits into
aliou:mainfrom
bjufre:fix/collapsed-dock-truncation
May 20, 2026
Merged

Fix collapsed dock wrapping#45
aliou merged 2 commits into
aliou:mainfrom
bjufre:fix/collapsed-dock-truncation

Conversation

@bjufre
Copy link
Copy Markdown
Contributor

@bjufre bjufre commented May 20, 2026

Problem

Long single-line process output can make the collapsed log dock hit the terminal right edge. In the screenshot, the dock row containing the CI URL is the pi-processes-owned part of the layout.

Before screenshot:
pi-processes-broken-layout-redacted

Scope note

The repeated loading/thinking rows above the dock are rendered by Pi core, not pi-processes. This PR does not claim to fix that part directly. It only removes right-edge pressure from the collapsed dock so the dock is not the source of terminal wrapping/overpaint at the bottom of the layout. If the loading rows still duplicate/misplace without dock wrapping, that likely needs a separate Pi TUI/core fix.

Cause

The collapsed dock padded rows to the full terminal width. That is risky at the terminal right edge when logs contain very long unbroken strings such as CI URLs.

Fix

  • Reserve one right-edge terminal column in collapsed dock rows.
  • Centralize collapsed-row truncation/padding in renderCollapsedDockLine.
  • Keep open dock rendering unchanged.
  • Add regression coverage for long CircleCI-style log lines, ANSI-styled lines, and narrow widths.

Verification

  • Confirmed latest upstream/published version is v0.9.1; no released fix present.
  • pnpm vitest run src/components/log-dock-component.test.ts
  • pnpm test
  • pnpm typecheck
  • pnpm lint

@bjufre bjufre force-pushed the fix/collapsed-dock-truncation branch from 7c6a9ed to 000f36b Compare May 20, 2026 12:57
@aliou
Copy link
Copy Markdown
Owner

aliou commented May 20, 2026

ah shit, sorry about that, let me test this

Copy link
Copy Markdown
Owner

@aliou aliou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This fixes the regression from collapsed dock rows filling the terminal width after the panel helper restore.\n\nChecked diff and ran:\n- pnpm test\n- pnpm typecheck\n- pnpm lint\n\nThe one-column reserve is scoped to collapsed dock rows and tests cover long unbroken URLs, ANSI-styled content, and narrow widths.

gpt 5.5 comment 💀

@aliou aliou merged commit abf847a into aliou:main May 20, 2026
1 check passed
@aliou
Copy link
Copy Markdown
Owner

aliou commented May 20, 2026

@bjufre Thanks for the fix! releasing in a few minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants